﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace NIEN_LUAN
{
    public partial class FormReportMatHang : Form
    {
         private Db.DataContentDataContext db = new NIEN_LUAN.Db.DataContentDataContext();
        private FormQuanLyMatHang frmMathang;

        public FormReportMatHang()
        {
            InitializeComponent();
        }


        public FormReportMatHang(FormQuanLyMatHang frm)
        {
            InitializeComponent();
            frmMathang = frm;
        }


        private void FormReportMatHang_Load(object sender, EventArgs e)
        {
            var hangton = (from m in db.MATHANGs
                            //where here                            
                            select new Db.Chitietchungtuthongke
                            {
                                MaHang=m.MaHang,
                                TenHang=m.TenHang,
                                DonGiaXuat=m.GiaBan??0,
                                GiaNhap=m.GiaNhap??0,
                                SoLuongTon=m.SoLuongHienCo??0,
                                MaLoaiHang=m.LOAIHANG.MaLoaiHang,
                                DonViTinh=m.DONVITINH.TenDonViTinh 
                            }).ToList();
            this.BindingSource.DataSource = hangton;
            this.reportViewer1.RefreshReport();
        }
    }
}
